home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
gsdbloo.exe
/
DEMOU001.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-02-20
|
1KB
|
57 lines
program DemoU001;
{------------------------------------------------------------------------------
DBase File Maker
Useless Examples
Demo Program
Copyright (c) Richard F. Griffin
10 February 1992
102 Molded Stone Pl
Warner Robins, GA 31088
-------------------------------------------------------------
Demonstrates the use of GS_DB3Build to create a dBase file. A
file 'MYFILE.DBF' will be created.
-------------------------------------------------------------------------------}
uses
GS_Strng,
GS_dBase,
GS_dB3Wk;
type
FldRecPtr = ^FldRecTyp;
FldRecTyp = array[1..GS_dBase_MaxRecField] of GS_dBase_Field;
var
f : FldRecPtr;
t : string;
FLoc : integer;
procedure InsertField(s : string; t : char; l,d : integer);
begin
if FLoc >= GS_dBase_MaxRecField then exit;
inc(FLoc);
s := AllCaps(s);
CnvStrToAsc(s,f^[FLoc].FieldName,11);
f^[FLoc].FieldType := t;
f^[FLoc].FieldLen := l;
f^[FLoc].FieldDec := d;
f^[FLoc].FieldAddress := 0;
FillChar(f^[FLoc].Reserved,20,#0);
end;
begin
New(f);
FLoc := 0;
InsertField('FIELD1','C',8,0);
InsertField('SECOND','D',8,0);
InsertField('THIRD','L',1,0);
InsertField('FOURTH','N',6,2);
GS_dB3_Build('MYFILE',f,FLoc);
end.